<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateYsUserTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('user', function(Blueprint $table)
		{
			$table->increments('id')->comment('主键id');
			$table->string('phone', 11)->comment('手机号');
			$table->string('pwd')->nullable()->comment('密码');
			$table->string('head')->nullable()->comment('头像');
			$table->string('signature')->nullable()->comment('签名');
			$table->integer('birthday')->nullable()->comment('用户生日');
			$table->bigInteger('grade')->nullable()->default(0)->comment('等级');
			$table->integer('last_time')->nullable()->comment('用户最后一次登录时间');
			$table->string('nickname', 24)->nullable()->comment('用户昵称');
			$table->integer('register_time')->nullable()->comment('用户注册时间');
			$table->float('money', 10)->nullable()->default(0.00)->comment('用户金额');
			$table->integer('ys_coin')->nullable()->default(0)->comment('用户平台币');
			$table->tinyInteger('role')->nullable()->default(0)->comment('用户角色0为普通用户,1位作者');
			$table->tinyInteger('bar')->nullable()->default(0)->comment('用户是否开通吧功能0为未开通,1为已开通,2为认证吧主');
			$table->string('email', 48)->nullable()->comment('用户邮箱');
			$table->tinyInteger('authentication')->nullable()->default(0)->comment('认证信息0为未认证1为官方人员2为书评团3为头条达人');
			$table->tinyInteger('recommend')->nullable()->default(0)->comment('是否官方推荐1为推荐');
			$table->string('qqName', 12)->nullable()->comment('绑定qq账号');
			$table->string('wxName', 20)->nullable()->comment('绑定微信号');
			$table->string('wbName', 18)->nullable()->comment('绑定微博账号');
			$table->integer('flowers')->nullable()->default(0)->comment('用户鲜花数量');
			$table->tinyInteger('sex')->nullable()->default(2)->comment('性别1为男2为女');
			$table->string('wxUnionId', 32)->nullable()->comment('微信授权认证id');
			$table->string('qqUnionId', 32)->nullable()->comment('qq授权登录id');
			$table->string('wbUnionId', 32)->nullable()->comment('微博授权登录id');
			$table->tinyInteger('group')->nullable()->default(0)->comment('分组0为普通用户1为官方人员2书评团');
			$table->tinyInteger('is_author')->nullable()->default(0)->comment('作家认证0为未认证1为认证作家2为签约作家');
			$table->string('regId', 64)->nullable()->comment('小米推送用户regId');
			$table->boolean('is_banned')->default(false)->comment('1为封禁用户');
			$table->string('QQ')->nullable()->comment('用户的手机号');
            $table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('user');
	}

}
